package com.lagou.rpc.consumer.controller;

import com.lagou.rpc.api.IUserService;
import com.lagou.rpc.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Authther: mrwu
 * @date:2021/4/6-04
 * @Description:com.lagou.rpc.consumer.controller
 */
@Controller
public class UserController {

    @Autowired
    private IUserService iUserService;

    @GetMapping("/user")
    @ResponseBody
    public User getuser(int id){
        User user = iUserService.getById(id);
        return user;
    }
}
